<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>卡券提货</title>
    <link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="/website_exchange/static/src/css/bootstrap-datepicker3.min.css"/>
    <link href="/jst_website_ext/static/src/css/index.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>
    <script type="text/javascript" src="/web/static/lib/jquery.validate/jquery.validate.js"></script>
    <script type="text/javascript" src="/website_exchange/static/src/js/bootstrap-datepicker.min.js"></script>
    <script type="text/javascript" src="/website_exchange/static/src/js/bootstrap-datepicker.zh-CN.min.js"></script>
    <script type="text/javascript" src="/jst_website_ext/static/src/js/jst_website_ext.js"></script>
</head>

<body>
	<div id="heade">
    	<div class="heade">
        	<h3>服务热线：<i>021-55226529</i><a href="/kaquan/index">返回</a></h3>
        </div>
    </div>
    <div class="song">
    	<div class="so">
        	<div class="hd">
            	<ul>
                	<li><a href="/kaquan/index"><i>1</i> 输入卡券密码</a></li>
                    <li><a href="#"><i>2</i> 填写送货地址</a></li>
                    <li style="margin-right:0;" class="li2"><a href="#"><i>3</i> OK,好啦</a></li>
                </ul>
            </div>
            <div class="bd">
                <div class="container mt16 mb8 small-box">
                    <% if exchange_ok %>
                        <!--<div class="alert alert-success" role="alert">兑换成功</div>-->
                        <h3>卡券提货结果</h3>
                    <% endif %>
                    <% if not exchange_ok %>
                        <h3>卡券提货查询</h3>
                    <% endif %>
                    <% if card %>
                        <% if card['is_exchanged'] and exchange %>
                            <table class="table">
                                <tbody>
                                    <tr>
                                        <td class="exchange-detail-title"><store>卡券号码</store></td>
                                        <td>
                                            ${card['code']}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="exchange-detail-title"><store>卡券产品</store></td>
                                        <td>
                                            ${exchange.get('product_name')}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="exchange-detail-title"><store>收货人</store></td>
                                        <td>
                                            ${exchange['to_name']}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="exchange-detail-title"><store>手机</store></td>
                                        <td>
                                            ${exchange['mobile_number']}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="exchange-detail-title"><store>收货地址</store></td>
                                        <td>
                                            ${exchange['province_name']}
                                            ${exchange['city_name']}
                                            ${exchange['county_name']}
                                            ${exchange['address']}
                                        </td>
                                    </tr>
                                    <!-- 如果已分配给门店并且不需要发货，则认为是门店上门自提 -->
                                    <% if exchange['assigned_shop_id'] and not exchange['is_need_delivery'] %>
                                        <tr>
                                            <td class="exchange-detail-title"><store>已门店自提</store></td>
                                            <td>
                                                提货日期：${exchange['shop_accept_datetime']}
                                            </td>
                                        </tr>
                                    <% endif %>
                                    <!-- 如果不是门店上门自提 -->
                                    <% if exchange['is_need_delivery'] %>
                                        <tr>
                                            <td class="exchange-detail-title"><store>预定发货日期</store></td>
                                            <td>
                                                ${exchange['estimated_ship_date']}
                                            </td>
                                        </tr>
                                    <% endif %>
                                    <!-- 如果已发货并且有快递方式并且有发货单号，则认为已发货 -->
                                    <% if exchange['is_shipping'] and exchange['shipping_type'] and exchange['shipping_code'] %>
                                        <tr>
                                            <td class="exchange-detail-title"><store>快递类型</store></td>
                                            <td>
                                                ${exchange['express_type_name']}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><store>快递单号</store></td>
                                            <td>
                                                ${exchange['shipping_code']}
                                            </td>
                                        </tr>
                                        <tr><td colspan="2">
                                            <store>物流详情</store>
                                        </td></tr>
                                        <tr>
                                            <td id="express-delivery-detail" data-shipping-type="exchange['express_type_com']"
                                                    data-shipping-code="exchange['shipping_code']" colspan="2">
                                                <button type="button" class="btn btn-default" onclick="search_express_detail(this)">查看物流详情</button>
                                            </td>
                                        </tr>
                                    <% endif %>
                                </tbody>
                            </table>
                        <% endif %>
                        <% if not card['is_exchanged'] or not exchange %>
                            <strong>错误:</strong>
                            <div class="alert alert-danger" role="alert">
                                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" />
                                卡券兑换记录不存在
                            </div>
                        <% endif %>
                    <% endif %>
                    <% if not card%>
                        <strong>错误:</strong>
                        <div class="alert alert-danger" role="alert">
                            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" />
                            卡券号码不存在
                        </div>
                    <% endif %>
                </div>
            </div>
        </div>
        <p class="pp"><img src="/jst_website_ext/static/src/images/yin.png" width="846" height="32"></p>
        <% include "common/foot.html" %>
        </div>
    </div>
<!--<script type="text/javascript">jQuery(".ka").slide();</script>-->
</body>
</html>
